package com.jia.coupons.controller;

import com.jia.coupons.entity.VoucherOrder;
import com.jia.coupons.service.VoucherOrderService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (VoucherOrder)表控制层
 *
 * @author makejava
 * @since 2024-10-06 23:43:08
 */
@RestController
@RequestMapping("voucher/order")
public class VoucherOrderController {
    /**
     * 服务对象
     */
    @Resource
    private VoucherOrderService voucherOrderService;

    /**
     * 新增数据
     *
     * @param voucherId 实体
     * @return 新增结果
     */
    @PostMapping("/add/{voucherId}")
    public ResponseEntity<VoucherOrder> add(@PathVariable("voucherId") Long voucherId) {
        return ResponseEntity.ok(this.voucherOrderService.insertOrder(voucherId));
    }


}

